﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Adjust.aspx.cs" Inherits="Basic4Net.OAWeb.Module_Accounting.Adjust" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../App_Themes/ui-lightness/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Scripts/jquery-1.4.1.js"></script>
    <script type="text/javascript" src="../Scripts/common.js"></script>
    <script type="text/javascript" src="../Scripts/Util.js"></script>
    <script language="javascript" type="text/javascript">
        function Search() {
            var btn = document.getElementById("btnBind");
            btn.click();
        }

        function OnChange(meritpayid,type) {
            var subsidycls = document.getElementById("SubsidyCls" + meritpayid);
            var holidaywork = document.getElementById("HolidayWork" + meritpayid);
            var amountdiffer = document.getElementById("AmountDiffer" + meritpayid);
            var holidayworkcontent = document.getElementById("HolidayWorkContent" + meritpayid);
            var amountdiffercontent = document.getElementById("AmountDifferContent" + meritpayid);
            if (type == 1) {
                var patrn = /^(([1-9]{1}\d*)|([0]{1}))(\.(\d){1,2})?$/;
                if (!patrn.exec(subsidycls.value)) {
                    subsidycls.value = "0";
                }
                else {
                    PageMethods.ChangeData(meritpayid, type, subsidycls.value);
                }
            }
            if (type == 2) {
                var patrn = /^(([1-9]{1}\d*)|([0]{1}))(\.(\d){1,2})?$/;
                if (!patrn.exec(holidaywork.value)) {
                    holidaywork.value = "0";
                }
                else {
                    PageMethods.ChangeData(meritpayid, type, holidaywork.value);
                }
            }
            if (type == 3) {
                var patrn = /^(-?\d+)(\.\d+)?$/; 
                if (!patrn.exec(amountdiffer.value)) {
                    amountdiffer.value = "0";
                }
                else {
                    PageMethods.ChangeData(meritpayid, type, amountdiffer.value);
                }
            }
            if (type == 4) {
                holidayworkcontent.value = holidayworkcontent.value.replace(/<[^>].*?>/g, "");
                PageMethods.ChangeData(meritpayid, type, holidayworkcontent.value);
            }
            if (type == 5) {
                amountdiffercontent.value = amountdiffercontent.value.replace(/<[^>].*?>/g, "");
                PageMethods.ChangeData(meritpayid, type, amountdiffercontent.value);
            }
        }

        function TopClick() {
            document.getElementById("txt_Go").value = 1;
            document.getElementById("btnBind").click();
            document.getElementById("lbl_ToPage").innerHTML = 1;
        }

        function UpClick() {
            var txt = document.getElementById("txt_Go");
            if (parseInt(txt.value) > 1) {
                txt.value = parseInt(txt.value) - 1;
                document.getElementById("btnBind").click();
                document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
            }
        }

        function NextClick() {
            var txt = document.getElementById("txt_Go");
            if (parseInt(txt.value) < parseInt(document.getElementById("lbl_PageCount").innerHTML)) {
                txt.value = parseInt(txt.value) + 1;
                document.getElementById("btnBind").click();
                document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
            }
        }

        function EndClick() {
            document.getElementById("txt_Go").value = document.getElementById("lbl_PageCount").innerHTML;
            document.getElementById("btnBind").click();
            document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
        }

        function GoClick() {
            var txt = document.getElementById("txt_Go");
            if (parseInt(txt.value) >= parseInt(document.getElementById("lbl_PageCount").innerHTML)) {
                txt.value = document.getElementById("lbl_PageCount").innerHTML;
            }
            document.getElementById("btnBind").click();
            var patrn = /^[1-9]\d*$/;
            if (patrn.exec(txt.value)) {
                document.getElementById("lbl_ToPage").innerHTML = txt.value;
            } 

        }

        function ChangeHolwithhold() {
            var ckb = document.getElementById("cbx_Holwithhold");
            PageMethods.ChangeHolwithhold(ckb.checked);
            Search();
        }

        function ChangeWithholdMoney() {
            var ckb = document.getElementById("cbn_WithholdMoney");
            PageMethods.ChangeWithholdMoney(ckb.checked);
            Search();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
        <div class="mainWarp">
            <div class="pageBody">

            <table style="width: 100%;">
            <tr>
                <td colspan="6" style="height:40px">
                </td>
            </tr>
            <tr>
                
                <td style="text-align:right;width:100px">
                    分类：
                </td>
                <td style="width:100px">
                    
                    <asp:DropDownList ID="ddl_FType" runat="server">
                    </asp:DropDownList>
                </td>
                <td style="text-align:left">
                    工号：<asp:TextBox ID="txt_TeacherCode" runat="server"></asp:TextBox>
                </td>
                <td style="text-align:left">
                    姓名：<asp:TextBox ID="txt_TeacherName" runat="server"></asp:TextBox>
                </td>
                <td style="width:35%;text-align:left">
                    <input id="btn_Search" type="button" onclick="Search()" class="commonBut" 
                        value="搜索" />
                </td>
                <td >

                </td>
            </tr>
            <tr>
                <td colspan="6" style="height:20px">
                    
                </td>
            </tr>
            <tr>
                <td colspan="6" align="center">
                    
                
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                               <asp:Repeater ID="rpt_TeacherType" runat="server"  >
                                <HeaderTemplate>
                                <table id="settingTable" style="width:90%" class="useList1" border="0" cellpadding="0" cellspacing="1">
                                    <tr  class="tableTitle">
                                        <th>
                                            职务分类
                                        </th>
                                        <th>
                                            工号
                                        </th>
                                        <th>
                                            姓名
                                        </th>
                                        <th>
                                            班补
                                        </th>
                                        <th>
                                            寒暑假扣款<br />
                                            <input id="cbx_Holwithhold" onclick="ChangeHolwithhold();" <%# GetHolwithholdState() %> type="checkbox" />扣款
                                        </th>
                                        <th>
                                            奖教学奖<br />
                                            <input id="cbn_WithholdMoney" onclick="ChangeWithholdMoney();" <%# GetWithholdMoneyState() %> type="checkbox" />发奖
                                        </th>
                                        <th>
                                            假期值班
                                        </th>
                                        <th>
                                            差额调整
                                        </th>
                                        <th>值班备注</th>
                                        <th>调整差额备注</th>
                                    </tr>
                                </HeaderTemplate>
                            <ItemTemplate>
                            <tr >
                                <td style="text-align:left">
                                    <%# DataBinder.Eval(Container.DataItem, "TypeName")%>
                                </td>
                                <td style="text-align:left">
                                    <%# DataBinder.Eval(Container.DataItem, "TeachCode")%>
                                </td>
                                <td style="text-align:left">
                                    <%# DataBinder.Eval(Container.DataItem, "TeachName")%>
                                </td>
                                <td>
                                    <input id='SubsidyCls<%# DataBinder.Eval(Container.DataItem, "MeritPayID")%>' value='<%# DataBinder.Eval(Container.DataItem, "SubsidyCls")%>' onkeypress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false" onchange='OnChange(<%# DataBinder.Eval(Container.DataItem, "MeritPayID")%>,1);' type="text" style="width:50px;text-align:right" />
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "Holwithhold")%>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "WithholdMoney")%>
                                </td>
                                <td>
                                    <input id='HolidayWork<%# DataBinder.Eval(Container.DataItem, "MeritPayID")%>' value='<%# DataBinder.Eval(Container.DataItem, "HolidayWork")%>' onkeypress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false" onchange='OnChange(<%# DataBinder.Eval(Container.DataItem, "MeritPayID")%>,2);' type="text" style="width:50px;text-align:right" />
                                </td>
                                <td>
                                    <input id='AmountDiffer<%# DataBinder.Eval(Container.DataItem, "MeritPayID")%>' value='<%# DataBinder.Eval(Container.DataItem, "AmountDiffer")%>' onkeypress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false" onchange='OnChange(<%# DataBinder.Eval(Container.DataItem, "MeritPayID")%>,3);' type="text" style="width:50px;text-align:right" />
                                </td>
                                <td>
                                    <textarea id='HolidayWorkContent<%# DataBinder.Eval(Container.DataItem, "MeritPayID")%>' style="text-align:left" onchange='OnChange(<%# DataBinder.Eval(Container.DataItem, "MeritPayID")%>,4);' cols="20" rows="2"><%# DataBinder.Eval(Container.DataItem, "HolidayWorkContent").ToString() %></textarea>
                                    
                                </td>
                                <td>
                                    <textarea id='AmountDifferContent<%# DataBinder.Eval(Container.DataItem, "MeritPayID")%>' style="text-align:left" onchange='OnChange(<%# DataBinder.Eval(Container.DataItem, "MeritPayID")%>,5);' cols="20" rows="2"><%# DataBinder.Eval(Container.DataItem, "AmountDifferContent").ToString() %></textarea>
                                </td>
                            </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                            </asp:Repeater>
                    <div class="page" style="width:60%;margin-top:10px">
                    <span ><input id="lbnTop" type="button" value="首页" class="commonBut" onclick="TopClick()" /></span>
                    <span ><input id="lbnUp" type="button" value="上一页" class="commonBut" onclick="UpClick()" /></span>
                    <span ><input id="lbnNext" type="button" value="下一页" class="commonBut" onclick="NextClick()" /></span>
                    <span ><input id="lbnEnd" type="button" value="末页" class="commonBut" onclick="EndClick()" /></span>
                    <span class="disabled"><asp:Label ID="lbl_L_Di" runat="server" Text="第"></asp:Label> <asp:Label ID="lbl_ToPage" runat="server" Text="0"></asp:Label> / <asp:Label ID="lbl_PageCount" runat="server" Text="0"></asp:Label> <asp:Label ID="lbl_L_Yie" runat="server" Text="页"></asp:Label></span>
                    <span ><asp:Label ID="lbl_L_TD" runat="server" Text="跳到"></asp:Label><span class="shoppingnumber">
                                        <asp:TextBox ID="txt_Go" CssClass="logininput" Text="" runat="server" Width="50px"></asp:TextBox>
                                        <asp:regularexpressionvalidator id="REV_Go" runat="server" ErrorMessage="RegularExpressionValidator" Display="Dynamic"
					                        ControlToValidate="txt_Go" ValidationExpression="^[1-9]\d*$">*</asp:regularexpressionvalidator>
                                        </span><asp:Label ID="lbl_L_Yie2" runat="server" Text="页"></asp:Label></span>
                    <span ><input id="lbnGo" type="button" value="跳转" class="commonBut" onclick="GoClick()" /></span>
                    </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnBind"  EventName="Click" />
                    </Triggers>

                </asp:UpdatePanel>
                    


                </td>
            </tr>
            <tr>
                <td ></td>
                <td></td>
                <td  align="center" style="height:50px">
                    
                </td>
                <td></td>
                <td >
                    
                </td>
                <td></td>
            </tr>
        </table>

            <div style="display: none;">
                <asp:Button ID="btnBind" runat="server" OnClick="btnBind_Click" Text="btnBind" />
            </div>

          </div>
        </div>
    </form>
</body>
</html>
